#pragma once
#include "material.h"
#include <cmath>


class stringer :public object {
public:
	stringer(double width, double thickness, double length, const material& mat) 
		: object(width, thickness, length, mat) 
	{
	}

	double inertia() const
	{
		return 1/12 * width * std::pow(thickness, 3) + thickness * width * sqr(thickness/2 - centroid()) + 
			1/12 * thickness * std::pow(width - thickness, 3) + thickness * (width - thickness) * sqr(thickness + width/2 - centroid());
	}	

	double centroid() const
	{
		 return (0.5* (  sqr(width) * thickness+ sqr(thickness) * ( width - thickness )))/ ( area() );
	}


	double weight () const
	{
		return area() * length * m.density;
	}

	double area() const
	{
		return 2 * (thickness * width)  - sqr(thickness);
	}


private:




};